package org.malred.hotelsystem.fragment.user;

import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.viewpager2.widget.ViewPager2;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.google.android.material.tabs.TabLayout;

import org.malred.hotelsystem.R;
import org.malred.hotelsystem.adapter.OrderPagerAdapter;
import org.malred.hotelsystem.adapter.UserOrderPagerAdapter;
import org.malred.hotelsystem.fragment.BaseFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * 用户系统 - 订单页
 */
public class UserOrderFragment extends BaseFragment {
    private static final String TAG = "UserOrderFragment";
    TabLayout mTabLayout;
    ViewPager2 mViewPager2;
    private List<String> mData = new ArrayList<>();

    @Override
    protected int setLayoutResourceID() {
        return R.layout.fragment_user_order;
    }

    @Override
    protected void setUpView() {
        mTabLayout = getContentView().findViewById(R.id.home_indicator);
        mViewPager2 = getContentView().findViewById(R.id.home_pager);
        UserOrderPagerAdapter homePagerAdapter = new UserOrderPagerAdapter(getActivity(), mData);
        mViewPager2.setAdapter(homePagerAdapter);
    }

    @Override
    protected void setUpData() {
        // 给每个页面的数据
        mData.add("页面1");
        mData.add("页面2");
        mData.add("页面3");
    }
}